package com.scedu;

import com.scedu.dao.StudentDao;
import com.scedu.entity.Student;
import com.scedu.utils.MybatisUtil;
import com.scedu.vo.QueryParam;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class App {
    public static void main(String[] args) {

        SqlSession sqlSession = MybatisUtil.getSqlSession();

        StudentDao mapper = sqlSession.getMapper(StudentDao.class);
        System.out.println("单个参数查询");
        Student student = mapper.selectStudentById(1);
        System.out.println(student);
        System.out.println("多个参数查询");
        List<Student> studentList = mapper.selectMultiParam("zs", 12);
        for (Student student1 : studentList) {
            System.out.println(student1);
        }
        System.out.println("统计数据");
        int i = mapper.countStudents();
        System.out.println(i);

    }
}
